﻿<!--***********************************************************************************

   Extended WPF Toolkit

   Copyright (C) 2007-2013 Xceed Software Inc.

   This program is provided to you under the terms of the Microsoft Public
   License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license 

   For more features, controls, and fast professional support,
   pick up the Plus Edition at http://xceed.com/wpf_toolkit

   Stay informed: follow @datagrid on Twitter or Like http://facebook.com/datagrids

  **********************************************************************************-->

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:media="clr-namespace:Xceed.Wpf.Toolkit.Core.Media"
                    xmlns:conv="clr-namespace:Xceed.Wpf.Toolkit.Core.Converters"
                    xmlns:primitives="clr-namespace:Xceed.Wpf.Toolkit.Primitives">


    <!-- =============================================================================== -->
    <!-- Images for the buttons and their various states                                 -->
    <!-- =============================================================================== -->

    <!-- ResizeGrip -->
    <ImageBrush x:Key="resize_grip" 
                ImageSource="Images/resize_grip.png" />

   <Style x:Key="buttonImageStyle" TargetType="Image">
      <Setter Property="Stretch" Value="None" />
      <Setter Property="UseLayoutRounding" Value="True" />
      <Setter Property="RenderOptions.EdgeMode" Value="Aliased" />
      <Setter Property="RenderOptions.BitmapScalingMode" Value="NearestNeighbor" />
   </Style>

    <!-- Minimize -->
   <BitmapImage x:Key="minimize_normal"
                UriSource="Images/minimize_normal.png" />
   <BitmapImage x:Key="minimize_hover"
                UriSource="Images/minimize_hover.png" />
   <BitmapImage x:Key="minimize_pressed"
                UriSource="Images/minimize_pressed.png" />
   <BitmapImage x:Key="minimize_inactive"
                UriSource="Images/minimize_inactive.png" />

    <!-- Maximize -->
   <BitmapImage x:Key="maximize_normal"
                UriSource="Images/maximize_normal.png" />
   <BitmapImage x:Key="maximize_hover"
                UriSource="Images/maximize_hover.png" />
   <BitmapImage x:Key="maximize_pressed"
                UriSource="Images/maximize_pressed.png" />
   <BitmapImage x:Key="maximize_inactive"
                UriSource="Images/maximize_inactive.png" />
   <BitmapImage x:Key="maximize_disabled"
                UriSource="Images/maximize_disabled.png" />

    <!-- Restore -->
   <BitmapImage x:Key="restore_normal"
                UriSource="Images/restore_normal.png" />
   <BitmapImage x:Key="restore_hover"
                UriSource="Images/restore_hover.png" />
   <BitmapImage x:Key="restore_pressed"
                UriSource="Images/restore_pressed.png" />
   <BitmapImage x:Key="restore_inactive"
                UriSource="Images/restore_inactive.png" />
   <BitmapImage x:Key="restore_disabled"
                UriSource="Images/restore_disabled.png" />

    <!-- Close -->
   <BitmapImage  x:Key="close_normal"
                 UriSource="Images/close_normal.png" />
   <BitmapImage  x:Key="close_hover"
                 UriSource="Images/close_hover.png" />
   <BitmapImage  x:Key="close_pressed"
                 UriSource="Images/close_pressed.png" />
   <BitmapImage  x:Key="close_inactive"
                 UriSource="Images/close_inactive.png" />

    <!-- Close (with 2 rounded corners) -->
   <BitmapImage x:Key="close_rounded_normal"
                UriSource="Images/close_rounded_normal.png" />
   <BitmapImage x:Key="close_rounded_hover"
                UriSource="Images/close_rounded_hover.png" />
   <BitmapImage x:Key="close_rounded_pressed"
                UriSource="Images/close_rounded_pressed.png" />
   <BitmapImage x:Key="close_rounded_inactive"
                UriSource="Images/close_rounded_inactive.png" />

    <!-- Close (for ToolWindow) -->
   <BitmapImage x:Key="close_toolwindow_normal"
                UriSource="Images/close_toolwindow_normal.png" />
   <BitmapImage x:Key="close_toolwindow_hover"
                UriSource="Images/close_toolwindow_hover.png" />
   <BitmapImage x:Key="close_toolwindow_pressed"
                UriSource="Images/close_toolwindow_pressed.png" />
   <BitmapImage x:Key="close_toolwindow_inactive"
                UriSource="Images/close_toolwindow_inactive.png" />


    <!-- =============================================================================== -->
    <!-- Common Styles                                                                   -->
    <!-- Need to find a way to share these for WindowControl and StylableWindow          -->
    <!-- =============================================================================== -->

    <!-- Button template -->
    <ControlTemplate x:Key="buttonTemplate" TargetType="Button">
        <Border Name="outerBorder" 
                Background="{TemplateBinding Background}" 
                BorderBrush="{TemplateBinding BorderBrush}"
                BorderThickness="{TemplateBinding BorderThickness}">
            <Image Source="{TemplateBinding Content}" Style="{StaticResource buttonImageStyle}"/>
        </Border>
    </ControlTemplate>

   <Style x:Key="windowButtonBaseStyle" TargetType="Button">
      <Setter Property="IsTabStop" Value="False" />
      <Setter Property="Margin" Value="0,-1,0,0" />
      <Setter Property="OverridesDefaultStyle" Value="True" />
      <Setter Property="Template" Value="{StaticResource buttonTemplate}" />
   </Style>

    <!--Default Close button style-->
   <Style x:Key="{ComponentResourceKey 
                  TypeInTargetAssembly={x:Type primitives:WindowControl}, 
                  ResourceId=DefaultCloseButtonStyle}"
           TargetType="Button" 
          BasedOn="{StaticResource windowButtonBaseStyle}">
      <Setter Property="ToolTip" Value="Close" />
      <Setter Property="Content" Value="{StaticResource close_normal}" />
        <Style.Triggers>
            <!-- Regular Window -->
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource TemplatedParent},Path=IsActive}" Value="False">
                <Setter Property="Content" Value="{StaticResource close_inactive}" />
            </DataTrigger>
            <Trigger Property="IsMouseOver" Value="True">
            <Setter Property="Content" Value="{StaticResource close_hover}" />
            </Trigger>
            <Trigger Property="IsPressed" Value="True">
            <Setter Property="Content" Value="{StaticResource close_pressed}" />
            </Trigger>

            <!-- NoResize (Close button with 2 rounded corners) -->

            <!-- Tool Window -->
            <Trigger Property="Name" Value="PART_ToolWindowCloseButton">
            <Setter Property="Content" Value="{StaticResource close_toolwindow_normal}" />
            </Trigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding RelativeSource={RelativeSource self},Path=Name}" Value="PART_ToolWindowCloseButton" />
                    <Condition Binding="{Binding RelativeSource={RelativeSource TemplatedParent},Path=IsActive}" Value="False" />
                </MultiDataTrigger.Conditions>
            <Setter Property="Content" Value="{StaticResource close_toolwindow_inactive}" />
            </MultiDataTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="Name" Value="PART_ToolWindowCloseButton" />
                    <Condition Property="IsMouseOver" Value="True" />
                </MultiTrigger.Conditions>
            <Setter Property="Content" Value="{StaticResource close_toolwindow_hover}" />
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="Name" Value="PART_ToolWindowCloseButton" />
                    <Condition Property="IsPressed" Value="True" />
                </MultiTrigger.Conditions>
            <Setter Property="Content" Value="{StaticResource close_toolwindow_pressed}" />
            </MultiTrigger>

        </Style.Triggers>
    </Style>






   <SolidColorBrush x:Key="Window_WindowBorderBrush" Color="#FF252C33" />

   <conv:ColorBlendConverter x:Key="Window_WindowBackground_converter" BlendedColor="#FFA0A0A0" BlendedColorRatio="0.35" />
   <SolidColorBrush x:Key="Window_WindowBackground" 
                    Color="{Binding 
                        Source={x:Static media:WindowColors.ColorizationColor}, 
                        Converter={StaticResource Window_WindowBackground_converter}}" 
                    Opacity="0.85"/>

   <SolidColorBrush x:Key="Window_Background"  Color="White"/>

   <conv:ColorBlendConverter x:Key="Window_WindowInactiveBackground_converter" BlendedColor="#FFF0F0F0" BlendedColorRatio="0.67" />
   <SolidColorBrush x:Key="Window_WindowInactiveBackground" 
                    Color="{Binding 
                        Source={x:Static media:WindowColors.ColorizationColor}, 
                        Converter={StaticResource Window_WindowInactiveBackground_converter}}" 
                    Opacity="0.85"/>

   <SolidColorBrush x:Key="Window_CaptionForeground" Color="Black"/>

   <Thickness x:Key="Window_WindowBorderThickness">1</Thickness>

   <!-- ========================================================================= -->
   <!-- Used by ColorPicker and ColorCanvas                                       -->
   <!-- ========================================================================= -->
   <DrawingBrush  x:Key="CheckerBrush" Viewport="0,0,10,10" ViewportUnits="Absolute" TileMode="Tile">
      <DrawingBrush.Drawing>
         <DrawingGroup>
            <GeometryDrawing Brush="White">
               <GeometryDrawing.Geometry>
                  <RectangleGeometry Rect="0,0 100,100" />
               </GeometryDrawing.Geometry>
            </GeometryDrawing>
            <GeometryDrawing Brush="LightGray">
               <GeometryDrawing.Geometry>
                  <GeometryGroup>
                     <RectangleGeometry Rect="0,0 50,50" />
                     <RectangleGeometry Rect="50,50 50,50" />
                  </GeometryGroup>
               </GeometryDrawing.Geometry>
            </GeometryDrawing>
         </DrawingGroup>
      </DrawingBrush.Drawing>
   </DrawingBrush>

</ResourceDictionary>
